﻿namespace OpenComposite.HumanActivity.Contracts
{
	using System;
	using System.Collections.Generic;
	using System.ServiceModel;
	using System.Xml;
	using System.Data;
	using System.Net.Security;

	[ServiceContract(Namespace = "http://www.theopencomposite.com/HumanActivity")]
	public interface IHumanActivityFormService
	{
		#region Methods

		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		bool StartActivity(int activityId, int userId);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		bool PostPoneActivity(int activityId, int userId, DateTime dtPostPone);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		bool CancelActivity(int activityId, int userId);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign), XmlSerializerFormat]
		bool CompleteActivity(int activityId, int userId);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign), XmlSerializerFormat]
		bool StopActivity(int activityId, int userId, string message, string details);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign), XmlSerializerFormat]
		bool AbortActivity(int activityId, int userId, string message, string details);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign), XmlSerializerFormat]
		bool FaultActivity(int activityId, int userId, string message, string details);

		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		bool UpdateActivityDueDate(int activityId, int userId, DateTime newDueDate, int remindeSecondsBefore);

		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		List<NoteItem> GetNotes(int activityId);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		bool SetNote(NoteItem note);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		bool DeleteNote(int noteId);

		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign), XmlSerializerFormat]
		XmlNode LoadData(int activityId, int userId);
		[OperationContract, FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign), XmlSerializerFormat]
		bool SaveData(int activityId, int userId, XmlNode xnData);

		[OperationContract(), FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		DataSet GetDelegations(int activityId);
		[OperationContract(), FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		DataSet GetUserRoles(int activityId);
		[OperationContract(), FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		DataSet GetPossibleOrgs(int activityId);
		[OperationContract(), FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		DataSet GetPossibleRoles(int activityId);

		[OperationContract(), FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		DataSet GetUsersForRole(int orgId, int roleId);

		[OperationContract(), FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		byte[] GetForm();
		[OperationContract(), FaultContract(typeof(HumanActivityFault), ProtectionLevel = ProtectionLevel.EncryptAndSign)]
		FormInfo GetFormInfo();
		#endregion Methods
	}
}